<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    isActive: Boolean,
    text: String,
  },
});
</script>

<template>
  <view class="tab-item">
    <view class="tab-item-line"></view>
    <view class="tab-item-text">{{ text }}</view>
    <image
      class="tab-item-arrow"
      :style="{ transform: isActive ? 'rotate(180deg)' : '' }"
      src="@/package/community/static/group-arrow.png"
    />
  </view>
</template>

<style lang="scss">
.tab-item {
  display: flex;
  align-items: center;
  height: 100rpx;
  padding-right: 30rpx;

  .tab-item-line {
    width: 6rpx;
    height: 36rpx;
    border-radius: 0 6rpx 6rpx 0;
    background-color: #ff7900;
  }

  .tab-item-text {
    flex-grow: 1;
    min-width: 0;
    padding-left: 32rpx;
    font-size: 28rpx;
    color: #2d2d2d;
    text-align: center;
    font-weight: bold;
  }

  .tab-item-arrow {
    width: 20rpx;
    height: 20rpx;
    transition: all 0.3s ease-out;
  }
}
</style>